package View;

import javax.swing.InputVerifier;
import javax.swing.JComponent;
import javax.swing.JTextField;

/**
 *
 * @author elach_000
 */
public class IntegerInputVerifier extends InputVerifier {

    @Override
    public boolean verify(JComponent input) {
        JTextField tf = (JTextField) input;
        
        boolean isInteger;
       
        try {
            Integer.parseInt(tf.getText());
            isInteger = true;
        } catch (Exception e) {
            isInteger = false;
        }
        
 	return isInteger;
    }
    
}
